cmake_minimum_required(VERSION 3.10)

if(TARGET "pplcv_static")
    return()
endif()

add_library(pplcv_static STATIC IMPORTED)

# --------------------------------------------------------------------------- #

set(__PPLCV_PACKAGE_ROOTDIR__ "${CMAKE_CURRENT_LIST_DIR}/../../..")
set(__PPLCV_LINK_LIBRARIES__)

if(NOT TARGET "pplcommon_static")
    include(${CMAKE_CURRENT_LIST_DIR}/pplcommon-config.cmake)
endif()
list(APPEND __PPLCV_LINK_LIBRARIES__ "pplcommon_static")

# --------------------------------------------------------------------------- #

# exported definitions

set(PPLCV_VERSION_MAJOR @PPLCV_VERSION_MAJOR@)
set(PPLCV_VERSION_MINOR @PPLCV_VERSION_MINOR@)
set(PPLCV_VERSION_PATCH @PPLCV_VERSION_PATCH@)

set(PPLCV_USE_X86 @PPLCV_USE_X86@)
set(PPLCV_USE_CUDA @PPLCV_USE_CUDA@)
set(PPLCV_USE_ARM @PPLCV_USE_ARM@)
set(PPLCV_USE_RISCV @PPLCV_USE_RISCV@)

set(PPLCV_INCLUDE_DIRS "${__PPLCV_PACKAGE_ROOTDIR__}/include")
set(PPLCV_LIBRARIES "pplcv_static")

# --------------------------------------------------------------------------- #

set_target_properties(pplcv_static PROPERTIES
    INTERFACE_LINK_LIBRARIES "${__PPLCV_LINK_LIBRARIES__}")

if(MSVC)
    set_target_properties(pplcv_static PROPERTIES
        IMPORTED_LOCATION "${__PPLCV_PACKAGE_ROOTDIR__}/lib/pplcv_static.lib"
        IMPORTED_LOCATION_DEBUG "${__PPLCV_PACKAGE_ROOTDIR__}/lib/pplcv_static.lib"
        IMPORTED_LOCATION_RELEASE "${__PPLCV_PACKAGE_ROOTDIR__}/lib/pplcv_static.lib")
else()
    set_target_properties(pplcv_static PROPERTIES
        IMPORTED_LOCATION "${__PPLCV_PACKAGE_ROOTDIR__}/lib/libpplcv_static.a"
        IMPORTED_LOCATION_DEBUG "${__PPLCV_PACKAGE_ROOTDIR__}/lib/libpplcv_static.a"
        IMPORTED_LOCATION_RELEASE "${__PPLCV_PACKAGE_ROOTDIR__}/lib/libpplcv_static.a")
endif()

# --------------------------------------------------------------------------- #

unset(__PPLCV_LINK_LIBRARIES__)
unset(__PPLCV_PACKAGE_ROOTDIR__)
